#include <stdio.h>
#include "StudentSystem.h"
void BubbleSort(stu* head)
{
	stu *p, *q, *a;
	p = head;
	q = head->next;
	printf("111111111111111");
	while(q != NULL)
	{
		while(q->next != NULL)
		{
			//从大到小
			if(q->score < q->next->score)
			{
				printf("33333");
				a = p->next;
				p->next = q->next;
				q->next = q->next->next;
				p->next->next = a;
			}
			else
			{
				q = q->next;
			}
	
		}
		p = p->next;
		q = p->next;
	}
	p = head->next;
	printf("\n成绩从高到低排名为:\n");
	printf("学生信息:\n \t姓名 \t年龄 \t性别 \t专业 \t学号 \t成绩\n");
	while(p != NULL)
	{
		
		printf("%s", p->name);
		printf("%hd", p->age);
		printf("%s", p->sex);
		printf("%s", p->major);
		printf("%s", p->id);
		printf("%d", p->score);
		printf("\n");
		p = p->next;
	}
}
